<template>
    <div id="loginContent">
        <div>
            <p>注册界面</p>
            <i class="el-icon-user-solid" style="color:aqua"></i>
            <input v-model="username" type="text" placeholder="请输入你的账户"><br>
            <i class="el-icon-warning" style="color:aqua"></i>
            <input v-model="password" type="text" placeholder="请输入你的密码"><br>
            <input type="button" @click="regist" value="注册">
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            username:'',
            password:''
        }
    },
    methods:{
        regist(){
            this.$axios.get('/api/registreq',{
                params:{
                    username:this.username,
                    password:this.password
                }
            }).then(res=>{
                if(res.data=="1"){
                    this.$router.push({path:"/login",query:{
                        plan:res.data
                    }})
                }
                else if(res.data=="0"){
                    alert("重新注册")
                }
            })
        }
    }
}
</script>
<style scoped>
#loginContent{
        width: 100%;
        height:600px;
        background-color: #353434;;
        background-size: cover;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-size: 30px;
        color:white;
}
#loginContent i{
    vertical-align: bottom;
    margin: 0 10px;
}
#loginContent input[type=text]{
    width: 300px;
    height: 50px;
    border:none;
    background-color: transparent;
    border-bottom: 2px solid aqua;
    margin-top:20px;

}
#loginContent input[type=button]{
    width: 300px;
    height: 50px;
    border:none;
    background-color: aqua;
    margin-top:50px;
    margin-left:45px;
    color: white;
}
</style>